package cn.zhuzicc.concurrent.demo07_biased_lock;

import org.openjdk.jol.info.ClassLayout;

/**
 * @author zhaoxiang
 * @version 1.0
 * @description 查看偏量锁
 * @Date 2021/9/18 15:08
 */
public class BiasedLock {
    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        myThread.start();
    }
}

class MyThread extends Thread {
    static Object obj = new Object();
    @Override
    public void run(){
        for (int i = 0; i < 5; i++) {
            synchronized (obj) {
                System.out.println(ClassLayout.parseInstance(obj).toPrintable());
            }
        }
    }
}